#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
	freopen("tree.in","r",stdin);
	freopen("tree.out","w",stdout);
	int t;
	scanf("%d",&t);
	while(t--)
	{
		ll n;
		scanf("%lld",&n);
		if(!n)
		{
			puts("2");
			continue;
		}
		ll l=1,r=1e18;
		while(l<r)
		{
			ll mid=l+(r-l)/2;
			if((__int128)mid*(mid-1)/2-(__int128)(1+mid/2)*(mid/2)/2-(__int128)(1+(mid-1)/2)*((mid-1)/2)/2<n)
				l=mid+1;
			else
				r=mid;
		}
		if(!(l%2)&&n%2)
			l++;
		printf("%lld\n",l);
	}
	return 0;
}
